home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Telnet 2.7b5 / source / tek / rgmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-02  |  2.2 KB  |  130 lines  |  [TEXT/CWIE]

  1. /*
  2. rgmp.c by Gaige B. Paulsen
  3.   spawned from rgp.c by Aaron Contorer for NCSA
  4. Copyright 1987, board of trustees, University of Illinois
  5.  
  6. Routines for Macintosh Picture output.  Only one Real device is available
  7. */
  8.  
  9. #ifdef MPW
  10. #pragma segment TEKMacPic
  11. #endif
  12.  
  13.  
  14. #define INXMAX 4096
  15. #define INYMAX 4096
  16.  
  17. #include "rgmp.proto.h"
  18.  
  19. void    TEKMacPicunload(void) {}
  20.  
  21. char    RGMPbusy; /* is device already in use */
  22. short    RGMPwidth, RGMPheight, RGMPxoffset=0, RGMPyoffset=0;
  23. int RGMPcolor[]=
  24.     { 30,            /* black */
  25.       33,            /* white */
  26.       205,            /* red */
  27.       341,            /* green */
  28.       409,            /* blue */
  29.       273,            /* cyan */
  30.       137,            /* magenta */
  31.       69            /* yellow */
  32.       };
  33.  
  34. short    RGMPnewwin(void)
  35. {
  36.  
  37.     RGMPbusy=1;
  38.  
  39. /*    RGMPwidth=4096;
  40.     RGMPheight=4096;     */
  41.     RGMPxoffset=0;
  42.     RGMPyoffset=0;
  43.  
  44.     return(0);
  45. }
  46.  
  47. char    *RGMPdevname(void)
  48. {
  49.     return("Macintosh PICTURE output");
  50. }
  51.  
  52. void    RGMPinit(void)
  53. {
  54.     RGMPbusy=0;
  55.  
  56. /*    RGMPwidth=4096;
  57.     RGMPheight=4096; */
  58.     RGMPxoffset=0;
  59.     RGMPyoffset=0;
  60. }
  61.  
  62. short    RGMPpencolor(short w, short color)
  63. {
  64.     UNUSED_ARG(w)
  65.     ForeColor( (long) RGMPcolor[color] );
  66.     return 0;
  67. }
  68.  
  69. short    RGMPclose(short w)
  70. {
  71.     UNUSED_ARG(w)
  72.     RGMPbusy=0;
  73.     return 0;
  74. }
  75.  
  76. short    RGMPpoint(short w, short x, short y)
  77. {
  78.     UNUSED_ARG(w)
  79.     MoveTo(x,y);
  80.     LineTo(x,y);
  81.     return 0;
  82. }
  83.  
  84. short    RGMPdrawline(short w, short x0, short y0, short x1, short y1)
  85. {
  86.     UNUSED_ARG(w)
  87.     x0 = RGMPxoffset + (short) ((long) x0 * RGMPwidth / INXMAX);
  88.     y0 = RGMPyoffset + RGMPheight - (short) ((long) y0 * RGMPheight / INYMAX);
  89.     x1 = RGMPxoffset + (short) ((long) x1 * RGMPwidth/INXMAX);
  90.     y1 = RGMPyoffset + RGMPheight - (short) ((long) y1 * RGMPheight / INYMAX);
  91.  
  92.     MoveTo(x0,y0);
  93.     LineTo(x1,y1);
  94.     return 0;
  95. }
  96.  
  97. void    RGMPinfo(short w, short v, short a, short b, short c, short d)
  98. {
  99.     UNUSED_ARG(w)
  100.     UNUSED_ARG(v)
  101.     UNUSED_ARG(a)
  102.     UNUSED_ARG(b)
  103.     UNUSED_ARG(c)
  104.     UNUSED_ARG(d)
  105. }
  106.  
  107. void    RGMPdataline(short blah, short blam, short bluh)
  108. {
  109.     UNUSED_ARG(blah)
  110.     UNUSED_ARG(blam)
  111.     UNUSED_ARG(bluh)
  112. }
  113.  
  114. void    RGMPcharmode(short w, short rotation, short size)
  115. {
  116.     UNUSED_ARG(w)
  117.     UNUSED_ARG(rotation)
  118.     UNUSED_ARG(size)
  119. }
  120.  
  121. short    RGMPsize(Rect *incoming)
  122. {
  123.     RGMPheight= incoming->bottom-incoming->top;
  124.     RGMPwidth = incoming->right - incoming->left;
  125.     RGMPyoffset= incoming->top;
  126.     RGMPxoffset= incoming->left; 
  127.  
  128.     return(0);
  129. }
  130.